impl Solution {
    pub fn diagonal_sum(mat: Vec<Vec<i32>>) -> i32 {
        let mut sum=0;
        let mut l=mat.len()-1;
        for i in 0..mat.len(){
            sum+=mat[i][i];
            sum+=mat[i][l-i];
        }
        l+=1;
        if l&1==1{
            sum-=mat[l/2][l/2];
        }
        
        sum
    }
}
